namespace tools {

	export function pop(text: string, params: hjc.TText, duration: number = 2): void {
		if (!text) return;
		let list = game.manager.layer.getInfoList();
		if (!list) {
			console.warn('cann\'t pop infomation without info layer...');
			return;
		}
		let lbl: eui.Label = ui.newLbl(text, params);//提示label
		lbl.maxWidth = ui.getStageWidth() - 100;
		list.addChild(lbl);
		if (duration > 0) egret.setTimeout(() => egret.Tween.get(lbl).to({ alpha: 0 }, 500)
			.call(() => ui.remove(lbl)), this, duration * 1000);
	}

	//弹出错误（红色）
	export function popErr(err: string, duration: number = 2.5): void {
		pop(err, { color: Color.RED, size: Font.Size.HUGE, stroke: 3, strokeColor: Color.BLACK }, duration);
	}
}